/**
 * Applikationsutveckling i Java, 5DV135
 * HT12
 * Project
 * 
 * File: BricksTest.java
 * Description: A JUnitTestCaseClass used to test the class Bricks
 * Date: 18 december 2012
 * 
 * cs-user: dv11mgr
 * @author Maria Gramner
 */

package nullInvader.Test;
import java.awt.Image;
import junit.framework.TestCase;
import nullInvader.Engine.Bricks;
import nullInvader.Engine.Unit;


public class BricksTest extends TestCase {

	Bricks brick;

	/**
	 * Test for the constructor
	 */
	public void testConstruction(){
		/*Creates a class to be able to test*/
		Bricks brick = new Bricks(true){
			protected void setIcon(){}
			public void landOn(Unit unit){}
			public void wasClicked(){}
			public Image getIcon() {
				return null;
			}
		};
		/*Checks that an object was made*/
		assertNotNull(brick);
	}


	/**
	 * Checks that the method isMovable() works correctly by
	 * first setting movable to true
	 */
	public void testIsMovable1(){
		Bricks brick = new Bricks(true){
			protected void setIcon(){}
			public void landOn(Unit unit){}
			public void wasClicked(){}
			public Image getIcon() {
				return null;
			}
		};
		assertEquals(true, brick.isMovable());
	}


	/**
	 * Checks that the method isMovable() still works correctly by
	 * setting movable to false
	 */
	public void testIsMovable2(){
		Bricks brick = new Bricks(false){
			protected void setIcon(){}
			public void landOn(Unit unit){}
			public void wasClicked(){}
			public Image getIcon() {
				return null;
			}
		};
		assertEquals(false, brick.isMovable());
	}
}
